package com.lcy.struct.bTreePlus.utils;

import java.util.Arrays;

/**
 * @author lucongyang
 * @date Created in  16:37
 * @description
 */
public class BplusUtils {
    public static void initByteArray(byte[]... bytes) {
        for (byte[] b : bytes) {
            Arrays.fill(b, (byte) 32);
        }
    }

    public static void initByteArray(byte[] bytes, int from) {
        Arrays.fill(bytes, from, bytes.length, (byte) 32);
    }

    /**
     * @param from inclusive
     */
    public static void replaceArr(byte[] toReplaceArr, byte[] src, int from) {
        int end = Math.min(from + src.length, toReplaceArr.length);
        int j = 0;
        for (int i = from; i < end; i++, j++) {
            toReplaceArr[i] = src[j];
        }
    }
}
